<template src="./template.html">

</template>

<script>
    import util from "@/utils/util";
    import imgInput from "../img_input.vue";
    // import commTemplate from '@/components/commTemplate.vue';

    import { loginService } from "@/services";
    import { Toast } from "mint-ui";
    export default {
        props:{
            switchOn:Boolean,
            perviewOn:Boolean,
            updateData:String,
        },
        data() {
            var serverUrl = 'http://skyforest.static.elab-plus.com/temp/template20/';
            return {
                uploading:false,
                disabled:false,
                serverUrl:serverUrl,
                isshow:true,
                obj:{
                    logoUrl:`${serverUrl}LOGO.png`,
                    logoUrl2:`${serverUrl}LOGO.png`,
                    logoUrl3:`${serverUrl}LOGO.png`,
                    logoUrl4:`${serverUrl}LOGO.png`,
                    logoUrl5:`${serverUrl}LOGO.png`,
                    banner1:`${serverUrl}bg1.png`,
                    title_logo:'',
                    title_logo2:'',
                    title_logo3:'',
                    title_logo4:'',
                    title_logo5:'',
                    title_big:'',
                    title_tip:'',
                    title1:'',
                    title2:'',
                    title3:'',
                    title4:'',
                    title5:'',
                    title6:'',
                    title7:'',
                    title8:'',
                    tel1:'',
                    tel_title:'',
                    tel2:'',
                    tel_title2:'',
                    tel3:'',
                    tel_title3:'',
                    tel4:'',
                    tel_title4:'',
                    bg_title:'',
                    bg_title2:'',
                    bg_title3:'',
                    bg_title4:'',
                    imageFile1:[`${serverUrl}pic1.png`,`${serverUrl}pic2.png`,`${serverUrl}pic4.png`],
                    imageFile2:[`${serverUrl}pic1.png`,`${serverUrl}pic2.png`,`${serverUrl}pic4.png`],
                    imageFile3:[`${serverUrl}pic1.png`,`${serverUrl}pic2.png`,`${serverUrl}pic4.png`],
                    imageFile4:[`${serverUrl}pic1.png`,`${serverUrl}pic2.png`,`${serverUrl}pic4.png`],
                }

            }
        },
        mounted() {

            console.log(this.updateData,'123465789');
            if(this.updateData){
                // console.log('1111');
                // console.log(val);
                this.obj=JSON.parse(this.updateData);
            }
        },
        watch:{
            switchOn(val){
                if(val){
                    // console.log('1111111',this.headerTitle1)
                    // console.log('2222222222',this.obj)
                    this.$emit('com',this.obj)
                }
            },
            perviewOn(val){
                // if(val){
                    // console.log(val);
                    this.disabled=val;
                    this.isshow=!val;
                // }
            },
            // perviewOff(val){
            //     if(val){
            //         // console.log(val);
            //         this.disabled=false;
            //         this.isshow=true;
            //         // console.log(this.isshow);
            //     }
            // },
            updateData(val){
                console.log(val,'123465789');
                if(val){
                    // console.log('1111');
                    // console.log(val);
                    val=JSON.parse(val);
                    this.obj = val;
                }
            }


        },
        methods: {},
        components:{
            imgInput,
            // commTemplate
        }
    }
</script>

<style lang="scss" scoped>
  @import "./style.scss"
</style>
<style>
    button.el-carousel__button{
        width: 25px !important;
    }
</style>
